<template>
	<view class="city">
		<change-city></change-city>
		<change-list :letter="letter" :city="city"></change-list>
		<change-alphabet @change="change" :city="city"></change-alphabet>
	</view>
</template>

<script>
	import changeCity from "../../components/changeHeader.vue";
	import changeList from "../../components/changeList.vue";
	import changeAlphabet from "../../components/changeAlphabet.vue";
	export default {
		components:{
			changeCity,
			changeList,
			changeAlphabet
		},
		data() {
			return {
				city:[],
				letter:[]
			}
		},
		methods: {
			getCityInfo(){
				let that = this;
				uni.request({
					url:"http://localhost:8099/api/city.json",
					success(res) {
						console.log(res.data.city);
						that.city=res.data.city;
						console.log(that.city);
					}
				})
			},
			change(res){
				// console.log(res);
				this.letter=res;
			}
		},
		created(){
			this.getCityInfo();
		}
	}
</script>

<style>
.city{
	background-color: #000000;
	width:100%;
	z-index: 19;
	height: 100%;
}
</style>
